#ifndef _ESP8266_UART_H_
#define _ESP8266_UART_H_

#include "public.h"


#define ESP8266_RXBUF_SIZE  1024
#define ESP8266_TXBUF_SIZE  1024

#define ESP8266_CH_PD_CLK       RCC_APB2Periph_GPIOG
#define ESP8266_CH_PD_PORT      GPIOG
#define ESP8266_CH_PD_PIN       GPIO_Pin_13

#define ESP8266_RST_CLK         RCC_APB2Periph_GPIOG
#define ESP8266_RST_PORT        GPIOG
#define ESP8266_RST_PIN         GPIO_Pin_14

#define ESP8266_USARTx          USART3
#define ESP8266_USART_CLK       RCC_APB1Periph_USART3
#define ESP8266_USART_GPIO_CLK  RCC_APB2Periph_GPIOB
#define ESP8266_USART_TX_PORT   GPIOB
#define ESP8266_USART_TX_PIN    GPIO_Pin_10
#define ESP8266_USART_RX_PORT   GPIOB
#define ESP8266_USART_RX_PIN    GPIO_Pin_11
#define ESP8266_USART_IRQ       USART3_IRQn     



void esp8266_uart_init(int bound);
unsigned int esp8266_uart_write(const void *buf, unsigned int len);
unsigned int esp8266_uart_read(void *buf, unsigned int len);

#endif // !_ESP8266_UART_H_




